package org.example;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class Main {
    public static void main(String[] args) {
        ApplicationContext context = new AnnotationConfigApplicationContext(AppConfig.class);
        OrderService orderService = context.getBean(OrderService.class);

        System.out.println("=== 测试 add 方法 ===");
        orderService.add("苹果", 5);

        System.out.println("\n=== 测试 delete 方法 ===");
        orderService.delete("苹果");

        System.out.println("\n=== 测试 find 方法 ===");
        int count = orderService.find("苹果");
        System.out.println("查询结果: " + count + " 个苹果");
    }
}